import React, { Component } from 'react';
import { withRouter } from 'react-router-dom';
import "./many.scss"
class ManyProduct extends Component {
    constructor(props) {
        super(props);
        this.state = {
            show: []
        }
    }
    componentDidMount() {
        console.log(this.props.location.state.list);
        this.setState({ show: this.props.location.state.productlist }, () => {
            console.log(this.state.show);
        })
    }
    
    render() {
        return (
            <div className='many'>
                {
                    this.state.show.map((item, index) => {
                        return (
                            <div className="showbox" key={index}>
                                <img src={item.img1} alt="" />
                                <div className="mean">
                                    <h5>{item.brand }</h5>
                                    <h4>{ item.proname}</h4>
                                </div>
                            </div>
                        )
                    })
                }
            </div >
        );
    }
}

export default withRouter(ManyProduct);